package com.itheima.tlias.controller;

import com.itheima.tlias.po.OperateLogPageParam;
import com.itheima.tlias.service.OperateLogService;
import com.itheima.tlias.util.ResultUtil;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

import java.util.Objects;

@CrossOrigin
@RestController
@RequestMapping("/log")
public class OperateLogController {

    @Resource
    OperateLogService logService;

    @GetMapping("/{page}")
    public ResultUtil selectAllLog(OperateLogPageParam param){
        if (Objects.isNull(param.getPage()) || Objects.isNull(param.getPageSize())) {
            return ResultUtil.fail("分页参数不存在");
        }
        return logService.selectAllLog(param);
    }
}
